package com.dd.common.dto.system.log;

import com.dd.common.validator.annotation.ValidTimeRange;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.PastOrPresent;
import java.time.LocalDateTime;

/**
 * @author cheng
 */
@ValidTimeRange(start = "startTime", end = "endTime")
@Schema(description = "定时任务日志查询DTO")
@Data
public class SysJobLogQueryDTO implements java.io.Serializable{
    @Schema(description = "任务名称", example = "签到")
    private String jobName;
    @Schema(description = "任务组名", example = "DEFAULT")
    private String jobGroup;
    @Schema(description = "调用目标字符串", example = "com.dd.job.service.impl.SysJobServiceImpl.run")
    private String invokeTarget;

    @Schema(description = "状态：1-成功，0-失败", example = "1")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer status;

    @PastOrPresent(message = "开始时间不能是未来时间")
    @Schema(description = "任务开始时间", type = "string", format = "date-time", example = "2024-01-01T00:00:00")
    private LocalDateTime startTime;

    @Schema(description = "任务结束时间", type = "string", format = "date-time", example = "2024-12-31T23:59:59")
    private LocalDateTime endTime;

}
